using System;
using NUnit.Framework;
using Pine.Core;
using Pine.Compiler.Utils;

namespace UnitTests
{
	[TestFixture]
	public class TestLoops
	{
		[Test]
		public void TestDoWhile() {
			ValueList rl = new ValueList();
			
			Compiler.ExecuteString("test-do-while", "main", @"
			\main() {
				var a = 0;
				do ++a; while (a < 5);
				return a;
			}", rl, null);
			
			Assert.AreEqual(new Number(5), rl.GetArrayElement(0));
		}
	}
}

